<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>{$_page.title}</title>
	<link href="{$_s.theme_dir}common.css" rel="stylesheet" type="text/css" />
	<link href="{$_s.theme_dir}manager.css" type="text/css" rel="stylesheet" />
	<script type="text/javascript" language="JavaScript" charset="utf-8" src="{$_s.js_dir}jQuery/jquery-1.8.3.min.js"></script>
	<!-- <script type="text/javascript" language="JavaScript" charset="utf-8" src="{$_s.js_dir}menu.js"></script> -->
	<script type="text/javascript" language="JavaScript" charset="utf-8" src="{$_s.js_dir}frame.js"></script>
</head>
<body id="iBody">

	<div class="topbar">
		<div class="ptitle">
			<a href="{$_s.web_url}">{$_page.title}</a>
			<a class="hide">
				
			</a>
		</div>
		<ul class="right">
			<!-- <li><a href="#" onclick="eori();return false;">&lt;&lt;</a></li> -->
			<!-- <li><a href="#" onclick="iore();return false;">&gt;&gt;</a></li> -->
			<li><a href="./m.php?frm=admin&mdl=admin&do=password" target="eBody">欢迎您：{$_manager.info.username}[{$_manager.info.rolename}]</a></li>
			<li><a href="./m.php?frm=user&mdl=notice&do=list" target="eBody">消息</a></li>
			<li><a href="./m.php?frm=admin&mdl=admin&do=setting" target="eBody">设置</a></li>
			<li><a href="./m.php?frm=index&mdl=menu&do=map" title="{$l.menu}{$l.map}" class="open_frame">菜单</a></li>
			<li><a href="{$_s.web_url}" target="iBody">商城</a></li>
			<li><a href="./m.php?mdl=logout">退出</a></li>
		</ul>
		
		<ul class="menu" id="main_menu">
			<!-- <li><a title="重新载入此页" class="poshytip refresh" href="http://egoo.e.cn/m.php?frm=goods&amp;mdl=goodscat&amp;do=edit&amp;id=2&amp;__debug__"></a></li>
			<li><a title="滚动到属性编辑区" class="poshytip" ttl="100" dir="#attrs">属性</a></li>
			<li><a title="滚动到规格编辑区" class="poshytip" ttl="100" dir="#specs">规格</a></li>
			<li><a title="滚动到隶属品牌区" class="poshytip" ttl="100" dir="#brand_list">品牌</a></li>
			<li><a title="回到页面最顶端" class="poshytip go-top" ttl="500" dir="div.topSpace"></a></li>
			<li><a title="滚动到操作区" class="poshytip go-cmd" ttl="500" dir="#cmd"></a></li>
			<li><a title="滚动到页面最底端" class="poshytip go-bottom" ttl="500" dir="#bottom"></a></li>
			<li><a title="滚动到调试信息区" class="poshytip go-debug" ttl="500" dir="#debug_info"></a></li> -->
		</ul>
		<div class="menu_tip"></div>

		
		<div class="clear"></div>
	</div>
	<div class="clear"></div>
	<div class="line"></div>
</body>
</html>
<script type="text/javascript" language="JavaScript" charset="utf-8">
<!--
	{literal}
	var _l = {};
	var _s = {};
	var _setting = {};
	{/literal}

	var _left_nav = 0;
	var _left_nav_img = ['{$_s.img_dir}gif/turn-left.gif', '{$_s.img_dir}gif/turn-right.gif'];
	var _left_nav_txt = ['[隐藏]左边导航栏', '[显示]左边导航栏'];

	{foreach from=$_s key=name item=val}
	_s['{$name}'] = '{$val}';
	{/foreach}

	// 用户设置
	{foreach from=$manager.setting key=name item=val}
	_setting['{$name}'] = '{$val}';
	{/foreach}

	{literal}

	if(win == null){
		win = top.frames['iBody'];
	}

	jQuery(function($){
		// 主体内容链接
		$('a[target=iBody]').click(function(event){
			event.stopPropagation();
			eori();
		});
		
		$('a[target=eBody]').click(function(event){
			event.stopPropagation();
			iore();
		});

		$('div.ptitle').hover(function(){
			$(this).children('a:first').hide().end()
				.children('a:last').show().text(_left_nav_txt[_left_nav]);
		}, function(){
			$(this).children('a:last').hide().end()
				.children('a:first').show();
		}).click(function(){
			_left_nav = 1 - _left_nav;
			$(this).find('a:last').text(_left_nav_txt[_left_nav]);

			sh_nav();
			$(this).trigger('blur');
			return false;
		});

		$('a.open_frame').click(function(){
		　　var title	= $(this).attr('title');
		　　var href	= $(this).attr('href');
		　　open_frame_in_goal(title, href);
		　　return false;
		});

		/*******************************************************************************
		 * 导航按钮动作
		 *******************************************************************************/

		// win.$.scrollTo(win.$('#cmd'), 500);

		$('#main_menu a').live('click', function(){
			var dir = $.trim($(this)[0].getAttribute('dir'));
			var ttl = parseInt($(this)[0].getAttribute('ttl'));
			var cls = $.trim($(this)[0].getAttribute('class'));
			var href = $.trim($(this)[0].getAttribute('href'));
			
			try{
				//eori();
				if(href != ''){
					win.location.href = href;
				}else{
					var target = win.$(dir);
					win.$.scrollTo(target, ttl, {axis:'y', queue:true, offset:-80});
				}
			}catch(e){}
			$(this).trigger('blur');
			return false;
		});

		$("#main_menu a").live({
			mouseenter: function(){
				var rel = $(this).attr('rel');
				if(rel == undefined){	// 由于title默认会有弹出，所以用rel替换
					$(this).attr('rel', $(this).attr('title'));
					$(this).attr('title', '');
				}
				$(this).parents('ul.menu').siblings('div.menu_tip').html($(this).attr('rel'));
			},
			mouseleave: function(){
				$(this).parents('ul.menu').siblings('div.menu_tip').html('');
			}
		});
	});


	function open_frame_in_goal(title, href){
		try{
			win.open_frame({'title':title, 'url':href});
		}catch(e){}
	}


	/*******************************************************************************
	 * 导航按钮
	 *******************************************************************************/

	function init_nav_btn(){
		$('#main_menu').html('');
	}
	function add_nav_btn(li){
		$('#main_menu').append(li);
	}

	/*******************************************************************************
	 * 消息
	 *******************************************************************************/

	(function(){
		var _self = arguments.callee;
		var secs = 60000;	// 没有消息，1分钟后再次尝试读取
		$.getJSON(
			'./m.php?frm=ajax&mdl=notice&do=get',
			function(data){
				if(data.result == 'yes'){
					secs = 10000;	// 如果有新消息，10秒后尝试读取下一条消息	
					var html = [];
					switch(data.notice.type){
						case '101':
							html.push('有<b>1</b>个新订单，<a href="./m.php?frm=order&mdl=order&do=edit&id='+data.notice.target+'">查看</a>') 
							break;
						case '102':
							html.push('有<b>1</b>个订单正在付款，<a href="./m.php?frm=order&mdl=order&do=edit&id='+data.notice.target+'">查看</a>') 
							break;
						case '103':
							html.push('有<b>1</b>个订单付款成功，<a href="./m.php?frm=order&mdl=order&do=edit&id='+data.notice.target+'">查看</a>') 
							break;
						case '104':
							html.push('有<b>1</b>个订单用户已收货，<a href="./m.php?frm=order&mdl=order&do=edit&id='+data.notice.target+'">查看</a>') 
							break;
						case '105':
							html.push('有<b>1</b>个订单有新的评价，<a href="./m.php?frm=order&mdl=order&do=edit&id='+data.notice.target+'">查看</a>') 
							break;
						case '201':
							html.push('有<b>1</b>个商品缺货，<a href="./m.php?frm=goods&mdl=goods&do=edit&id='+data.notice.target+'">查看</a>') 
							break;
						case '202':
							html.push('有<b>1</b>个商品被收藏，<a href="./m.php?frm=goods&mdl=goods&do=edit&id='+data.notice.target+'">查看</a>') 
							break;
					}
					html = html.join('<br />');
					try{
						win.pop_message(html);
					}catch(e){}
				}
				setTimeout(function(){_self();}, secs);
			}
		);
	})();
	{/literal}
-->
</script>